//--------------------------------------------------------------------------------------------------------------
// <copyright file="LogMessage.cs" company="Microsoft Corporation" author="David Martos" date="01/02/2008">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//--------------------------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Text;

namespace CSP.Core
{
    /// <summary>
    /// Enumeration with the log events which may occur in every CSP module
    /// </summary>
  public enum LogMessageType
  {
    CoreRegistryGenericError,
    CoreResourcesGenericError,
    CoreXslRendererGenericError,

    SimpleCRMGenericError,
    IncidentToDataSetError,
    IncidentCollectionToDataSetError,
    ContactToDataSetError,
    ContactCollectionToDataSetError,

    AddCaseSOAPError,
    AddCaseError,
    AddCaseInfoMessage,
    UpdateCaseSOAPError,
    UpdateCaseError,
    GetCasesSOAPError,
    GetCasesError,
    GetCasesInfoMessage,
    GetCasesByCaseTypeSOAPError,
    GetCasesByCaseTypeError,
    GetCasesByRoleTypeSOAPError,
    GetCasesByRoleTypeError,
    GetCasesByCaseStatusSOAPError,
    GetCasesByCaseStatusError,
    GetCaseByCaseIDSOAPError,
    GetCaseByCaseIDError,
    GetCasesByCitizenIDSOAPError,
    GetCasesByCitizenIDError,
    GetCaseTypesSOAPError,
    GetCaseTypesError,
    GetCaseStatusesByCaseTypeSOAPError,
    GetCaseStatusesByCaseTypeError,
    GetCaseRoleTypesSOAPError,
    GetCaseRoleTypesError,
    AddCitizenRequestSOAPError,
    AddCitizenRequestError,
    ApproveCitizenRequestSOAPError,
    ApproveCitizenRequestError,
    DenyCitizenRequestSOAPError,
    DenyCitizenRequestError,
    GetCitizensSOAPError,
    GetCitizensError,
    GetCitizenByUsernameSOAPError,
    GetCitizenByUsernameError,
    GetCitizenRequestsSOAPError,
    GetCitizenRequestsError,
    GetCitizenRequestsByUsernameSOAPError,
    GetCitizenRequestsByUsernameError,
    GetCaseFormXmlSOAPError,
    GetCaseFormXmlError,
    WebPartMapGenericError,
  }

    /// <summary>
    /// Class representing a log event of a Contoso module
    /// </summary>
    public class LogMessage
    {
        private LogMessageType _type;

        /// <summary>
        /// Log message type
        /// </summary>
        public LogMessageType Type
        {
            get { return _type; }
        }

        private object[] _parameters;

        /// <summary>
        /// Array of string parameters
        /// </summary>
        public object[] Parameters
        {
            get { return _parameters; }
        }

        /// <summary>
        /// Creates a log message specifiying its type
        /// </summary>
        /// <param name="type">Log message type</param>
        public LogMessage(LogMessageType type)
        {
            _type = type;
            _parameters = new object[0];
        }

        /// <summary>
        /// Creates a log message specifiying its type and a string parameter
        /// </summary>
        /// <param name="type">Log message type</param>
        /// <param name="parameter">String parameter</param>
        public LogMessage(LogMessageType type, string parameter)
        {
            _type = type;
            _parameters = new object[] { parameter };
        }

        /// <summary>
        /// Creates a log message specifiying its type and an array of string parameters
        /// </summary>
        /// <param name="type"></param>
        /// <param name="parameters">Array of string parameters</param>
        public LogMessage(LogMessageType type, object[] parameters)
        {
            _type = type;
            _parameters = parameters;
        }
    }
}
